// --*- C++ -*------x---------------------------------------------------------
// $Id: Polymer.h,v 1.3 2007-10-26 14:55:17 biocomp Exp $
//
// Class:           Polymer
// 
// Base class:      -
//
// Derived classes: - 
//
// Author:          Silvio Tosatto
//
// Project name:    -
//
// Date:            09/99
//
// Description:     -
// 
// -----------------x-------------------x-------------------x-----------------

#ifndef _POLYMER_H_
#define _POLYMER_H_
 
// Includes:
#include <Component.h>
#include <Debug.h>

// Global constants, typedefs, etc. (to avoid):

namespace Biopool {

class Polymer : public Component
{
public: 

// CONSTRUCTORS/DESTRUCTOR:
  Polymer(unsigned int mI = 2, unsigned int mO = 2); 
  Polymer(const Polymer& orig);
  virtual ~Polymer();

// PREDICATES:
  virtual string getClassName() const
    { return "Polymer"; }
  virtual vgVector3<double> getTrans() const
    { ERROR("Polymer::getTrans is not a viable method.", exception); }
  virtual vgMatrix3<double> getRot() const
    { ERROR("Polymer::getRot is not a viable method.", exception); }

  virtual void save(Saver& s)
    { ERROR("Polymer::save is not a viable method.", exception); }

// MODIFIERS:
  virtual void insertComponent(Component* c); 
  virtual void removeComponent(Component* c); 
  //---------------------------------
  virtual void removeComponentFromIndex(unsigned int i); 
  //---------------------------------
  virtual void deleteComponent(Component* c); 

  void copy(const Polymer& orig);
  virtual Component* clone();

  virtual void load(Loader& l)
    { ERROR("Polymer::load is not a viable method.", exception); }
  virtual void setTrans(vgVector3<double> t)
    { ERROR("Polymer::setTrans is not a viable method.", exception); }
  virtual void addTrans(vgVector3<double> t)
    { ERROR("Polymer::addTrans is not a viable method.", exception); }
  virtual void setRot(vgMatrix3<double> r)
    { ERROR("Polymer::setRot is not a viable method.", exception); }
  virtual void addRot(vgMatrix3<double> r)
    { ERROR("Polymer::addRot is not a viable method.", exception); }
  virtual void sync()   // synchronize coords with structure
    { ERROR("Polymer::sync is not a viable method.", exception); }

  virtual void acceptCalculator(EnergyVisitor* v)
    { ERROR("Polymer::acceptCalculator is not a viable method.", exception); }
  virtual void acceptOptimizer(OptimizationVisitor* v)
    { ERROR("Polymer::acceptOptimizer is not a viable method.", exception); }

// OPERATORS:
  virtual Component& operator[](unsigned int n);
  virtual const Component& operator[](unsigned int n) const;

protected:

// HELPERS:
  virtual void resetBoundaries()
    { ERROR("Polymer::resetBoundaries is not a viable method.", exception); }

private:
  
};


// ---------------------------------------------------------------------------
//                                    Polymer
// -----------------x-------------------x-------------------x-----------------

// PREDICATES:

// MODIFIERS:

// OPERATORS:
inline Component& 
Polymer::operator[](unsigned int n) 
{ 
  PRECOND( n < size(), exception);
  return *components[n]; 
}

inline const Component& 
Polymer::operator[](unsigned int n) const
{ 
  PRECOND( n < size(), exception);
  return *components[n]; 
}

} // namespace
#endif //_POLYMER_H_


